import math
import time

tmp = ''

while tmp.isdigit() == False:
    tmp = input('请输入一个整数：')

num = int(tmp)

t1 = time.time()
if num == 1:
    print ('1既不是质数也不是合数')
elif num % 2 == 0:
    print ('1既不是质数也不是合数')
else:
    for i in range(3,int(math.sqrt(num)), 2):
        if num % i == 0:
            print ('合数')
            break
    else:
        print ('质数')
t2 = time.time()
print(t2 - t1)
